package com.fbs.wowo.classify.web;


import com.fbs.wowo.base.BaseController;
import com.fbs.wowo.base.Response;
import com.fbs.wowo.classify.entity.Classify;
import com.fbs.wowo.classify.service.ClassifyService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("classify")
public class ClassifyController extends BaseController {

    @Resource
    private ClassifyService classifyService;

    /**
     * 插入数据
     */
    @PostMapping("insertClassify")
    @ResponseBody
    public Response insertClassify(Classify classify) {
        return success(classifyService.insertSelective(classify));
    }

    /**
     * 获取列表
     */
    @GetMapping("findClassifyList")
    @ResponseBody
    public Response findClassifyList() {
        return success(classifyService.findClassifyList());
    }

    /**
     * 获取类型详情
     */
    @GetMapping("findClassifyInfo")
    @ResponseBody
    public Response findClassifyInfo(String cId) {
        return success(classifyService.selectByPrimaryKey(cId));
    }
}
